package me.ereach.myapi.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import me.ereach.myapi.model.Products;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface ProductsMapper extends BaseMapper<Products> {
    @Select("select " +
            "product_id, name, quantity_in_stock, unit_price " +
            "from products " +
            "where name regexp #{name}")
    List<Products> getProductsByName(String name);
}